package com.sql.service.impl;

import com.sql.dao.UserMapping;
import com.sql.model.User;
import com.sql.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 走过全世界。 on 2017/5/30 0030.
 */
@Service("userService")
public class UserServiceImpl implements UserService {


    private UserMapping userMapping;

    public UserMapping getUserMapper() {
        return userMapping;
    }

    //此处警告不管
    @Autowired
    public void setUserMapper(UserMapping userMapping) {
        this.userMapping = userMapping;
    }

    public User getUserById(Integer id) {
        return userMapping.getUserById(id);
    }

    public User getUserByUsername(String username) {
        return userMapping.getUserByUsername(username);
    }

    public Integer insertNewUser(User user) {
        return userMapping.insertNewUser(user);
    }
}
